\hypertarget{class_music_player}{
\section{MusicPlayer Class Reference}
\label{class_music_player}\index{MusicPlayer@{MusicPlayer}}
}


Plays the game music using GStreamer.  


\subsection*{Public Slots}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_music_player_a38cff657419db51cbbf0468c559fa46d}{
void \hyperlink{class_music_player_a38cff657419db51cbbf0468c559fa46d}{setVolumeLevel} (int \hyperlink{class_music_player_af3d1d02299bde0469156f5e1dd223db9}{volumeLevel})}
\label{class_music_player_a38cff657419db51cbbf0468c559fa46d}

\begin{DoxyCompactList}\small\item\em Sets the playback volume to the GStreamer pipeline. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_music_player_a77cc1af23a61f1cb2b531d5c47a1cde5}{
\hyperlink{class_music_player_a77cc1af23a61f1cb2b531d5c47a1cde5}{MusicPlayer} (int \hyperlink{class_music_player_af3d1d02299bde0469156f5e1dd223db9}{volumeLevel}, QObject $\ast$parent=0)}
\label{class_music_player_a77cc1af23a61f1cb2b531d5c47a1cde5}

\begin{DoxyCompactList}\small\item\em Constructs \hyperlink{class_music_player}{MusicPlayer}. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_a3bc16c3be2206fabd90ce8ad3551d736}{
\hyperlink{class_music_player_a3bc16c3be2206fabd90ce8ad3551d736}{$\sim$MusicPlayer} ()}
\label{class_music_player_a3bc16c3be2206fabd90ce8ad3551d736}

\begin{DoxyCompactList}\small\item\em Destructs \hyperlink{class_music_player}{MusicPlayer} and stops the music playback. \item\end{DoxyCompactList}\item 
void \hyperlink{class_music_player_a9daaa102d8859d93d2c434a0f1975ba2}{play} ()
\begin{DoxyCompactList}\small\item\em Starts the music playback. \item\end{DoxyCompactList}\item 
void \hyperlink{class_music_player_a89de23c3c27f35347942f0b41728d17d}{playOnLoop} ()
\begin{DoxyCompactList}\small\item\em Starts the music playback. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_a54e47a9e937730493d886aa5624c44d1}{
void \hyperlink{class_music_player_a54e47a9e937730493d886aa5624c44d1}{stop} ()}
\label{class_music_player_a54e47a9e937730493d886aa5624c44d1}

\begin{DoxyCompactList}\small\item\em Stops the music playback. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Slots}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_music_player_a9b626a318fba20c2eeef79b91a1b7ca7}{
void \hyperlink{class_music_player_a9b626a318fba20c2eeef79b91a1b7ca7}{checkBusMessages} ()}
\label{class_music_player_a9b626a318fba20c2eeef79b91a1b7ca7}

\begin{DoxyCompactList}\small\item\em Checks the pipeline bus messages. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{class_music_player_a20903d16a79e53e2db378c09aba4c767}{initGtreamerPipeline} ()
\begin{DoxyCompactList}\small\item\em Initializes the GStreamer pipeline for music playback. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_a5718c75d179df3b161f479137c1331c9}{
void \hyperlink{class_music_player_a5718c75d179df3b161f479137c1331c9}{setPipelineVolume} ()}
\label{class_music_player_a5718c75d179df3b161f479137c1331c9}

\begin{DoxyCompactList}\small\item\em Sets the volume to GStreamer pipeline. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_music_player_af3d1d02299bde0469156f5e1dd223db9}{
int \hyperlink{class_music_player_af3d1d02299bde0469156f5e1dd223db9}{volumeLevel}}
\label{class_music_player_af3d1d02299bde0469156f5e1dd223db9}

\begin{DoxyCompactList}\small\item\em Current volume level. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_af3442d965746e0b669700750131cd5a0}{
QString \hyperlink{class_music_player_af3442d965746e0b669700750131cd5a0}{filepath}}
\label{class_music_player_af3442d965746e0b669700750131cd5a0}

\begin{DoxyCompactList}\small\item\em Path to music file. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_ac52b67773a2f62d0c8c086e992f061d5}{
bool \hyperlink{class_music_player_ac52b67773a2f62d0c8c086e992f061d5}{loopPlayback}}
\label{class_music_player_ac52b67773a2f62d0c8c086e992f061d5}

\begin{DoxyCompactList}\small\item\em Is the loop playback enabled. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_a67c65f984c4c5219f0168da6e3f9416b}{
bool \hyperlink{class_music_player_a67c65f984c4c5219f0168da6e3f9416b}{mp3Playback}}
\label{class_music_player_a67c65f984c4c5219f0168da6e3f9416b}

\begin{DoxyCompactList}\small\item\em Is the MP3 playback enabled. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_ab007dd0bf5540382483994e574078b07}{
QTimer $\ast$ \hyperlink{class_music_player_ab007dd0bf5540382483994e574078b07}{busTimer}}
\label{class_music_player_ab007dd0bf5540382483994e574078b07}

\begin{DoxyCompactList}\small\item\em Timer to check the pipeline bus messages. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_a3dce564ab7f774abf211c32bdd8f5a9d}{
MusicPlayerStatus \hyperlink{class_music_player_a3dce564ab7f774abf211c32bdd8f5a9d}{status}}
\label{class_music_player_a3dce564ab7f774abf211c32bdd8f5a9d}

\begin{DoxyCompactList}\small\item\em Player status. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_a802806e6f22440a9126d8b1c959dd34f}{
GstElement $\ast$ \hyperlink{class_music_player_a802806e6f22440a9126d8b1c959dd34f}{pipeline}}
\label{class_music_player_a802806e6f22440a9126d8b1c959dd34f}

\begin{DoxyCompactList}\small\item\em GStreamer pipeline to play OGG or MP3. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_a7b570b05783eeb01d0fec0b24f7dbe8b}{
GstElement $\ast$ \hyperlink{class_music_player_a7b570b05783eeb01d0fec0b24f7dbe8b}{source}}
\label{class_music_player_a7b570b05783eeb01d0fec0b24f7dbe8b}

\begin{DoxyCompactList}\small\item\em Source for sound data. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_aedf20fd0ef02915ad7601e638226f8a7}{
GstElement $\ast$ \hyperlink{class_music_player_aedf20fd0ef02915ad7601e638226f8a7}{demuxer}}
\label{class_music_player_aedf20fd0ef02915ad7601e638226f8a7}

\begin{DoxyCompactList}\small\item\em Demuxer for the OGG file playback. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_a0df202d5f8f29382d05293de43b78329}{
GstElement $\ast$ \hyperlink{class_music_player_a0df202d5f8f29382d05293de43b78329}{mp3parse}}
\label{class_music_player_a0df202d5f8f29382d05293de43b78329}

\begin{DoxyCompactList}\small\item\em Parser for the MP3 playback. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_a8a5dd9a059a789d3307ce048029d8222}{
GstElement $\ast$ \hyperlink{class_music_player_a8a5dd9a059a789d3307ce048029d8222}{decoder}}
\label{class_music_player_a8a5dd9a059a789d3307ce048029d8222}

\begin{DoxyCompactList}\small\item\em Decoder to decode the stream. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_ab46f7b6a8ce791e31b2548fb05f00154}{
GstElement $\ast$ \hyperlink{class_music_player_ab46f7b6a8ce791e31b2548fb05f00154}{converter}}
\label{class_music_player_ab46f7b6a8ce791e31b2548fb05f00154}

\begin{DoxyCompactList}\small\item\em Audio converter. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_a5061ea238de0117ea746caed7f27c630}{
GstElement $\ast$ \hyperlink{class_music_player_a5061ea238de0117ea746caed7f27c630}{volume}}
\label{class_music_player_a5061ea238de0117ea746caed7f27c630}

\begin{DoxyCompactList}\small\item\em For volume control. \item\end{DoxyCompactList}\item 
\hypertarget{class_music_player_ae16c4874e2136f741fad326644eb9883}{
GstElement $\ast$ \hyperlink{class_music_player_ae16c4874e2136f741fad326644eb9883}{sink}}
\label{class_music_player_ae16c4874e2136f741fad326644eb9883}

\begin{DoxyCompactList}\small\item\em Auto audio sink for output. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Plays the game music using GStreamer. The music file can be OGG or MP3 format. OGG format is default. If GStreamer OGG demuxer is not found then the MP3 format is used. 

\subsection{Member Function Documentation}
\hypertarget{class_music_player_a20903d16a79e53e2db378c09aba4c767}{
\index{MusicPlayer@{MusicPlayer}!initGtreamerPipeline@{initGtreamerPipeline}}
\index{initGtreamerPipeline@{initGtreamerPipeline}!MusicPlayer@{MusicPlayer}}
\subsubsection[{initGtreamerPipeline}]{\setlength{\rightskip}{0pt plus 5cm}void MusicPlayer::initGtreamerPipeline (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{class_music_player_a20903d16a79e53e2db378c09aba4c767}


Initializes the GStreamer pipeline for music playback. 

If GStreamer OGG demuxer is found uses OGG format else MP3 is used. \hypertarget{class_music_player_a9daaa102d8859d93d2c434a0f1975ba2}{
\index{MusicPlayer@{MusicPlayer}!play@{play}}
\index{play@{play}!MusicPlayer@{MusicPlayer}}
\subsubsection[{play}]{\setlength{\rightskip}{0pt plus 5cm}void MusicPlayer::play (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_music_player_a9daaa102d8859d93d2c434a0f1975ba2}


Starts the music playback. 

Plays the sound file once. \hypertarget{class_music_player_a89de23c3c27f35347942f0b41728d17d}{
\index{MusicPlayer@{MusicPlayer}!playOnLoop@{playOnLoop}}
\index{playOnLoop@{playOnLoop}!MusicPlayer@{MusicPlayer}}
\subsubsection[{playOnLoop}]{\setlength{\rightskip}{0pt plus 5cm}void MusicPlayer::playOnLoop (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_music_player_a89de23c3c27f35347942f0b41728d17d}


Starts the music playback. 

Plays the sound file on loop. 

The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
musicplayer.h\item 
musicplayer.cpp\end{DoxyCompactItemize}
